﻿Public Class frmExportMAJ
    Public pNo_ligne As Integer

    Private szSQL As String
    Private rs As ADODB.Recordset

    Private Sub frmExportMAJ_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        ' lire la ligne à maj
        szSQL = "SELECT * FROM t_sybel WHERE no_ligne = " & pNo_ligne
        GetRecordset(ctDSN_AEM, szSQL, rs)
        If rs.RecordCount > 0 Then
            TE_COMPTE.Text = rs.Fields("compte").Value
            TE_LIBELLE.Text = rs.Fields("libelle").Value
        End If
        rs.Close()

    End Sub

    Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton1.Click
        ' mise à jour 
        szSQL = "UPDATE t_sybel SET compte='" & TE_COMPTE.Text & "', libelle='" & TE_LIBELLE.Text & _
                "' WHERE no_ligne=" & pNo_ligne
        If ExecQuery(ctDSN_AEM, szSQL) Then
            Me.Close()
        End If
    End Sub

End Class